#ifndef __DLIST_H__
#define __DLIST_H__

#ifndef NULL
#define NULL 0
#endif

typedef struct _DList DList;

struct _DList
{
    DList *next;
    DList *prev;
};

void dlist_init (DList *dlist);
void dlist_insert_before (DList *node, DList *new, DList **head);
void dlist_insert_after (DList *node, DList *new);
void dlist_insert_tail (DList **head, DList *new_node);
void dlist_del (DList *node, DList **head);
void dlist_move (DList *des, DList *src, DList **head, int before);
void dlist_move_pre (DList *node, DList **head);
void dlist_move_next (DList *node, DList **head);
DList *dlist_next (DList *node);
DList *dlist_prev (DList *node);

#endif /* __DLIST_H__ */
